<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>cute-transfer: E:/CODE/CPPpro/cute-transfer/Msg&amp;FileTransfer/client.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">cute-transfer</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>文件列表</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">E:/CODE/CPPpro/cute-transfer/Msg&amp;FileTransfer/client.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef CLIENT_H_INCLUDED</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define CLIENT_H_INCLUDED</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;vector&gt;</span>
<a name="l00019"></a>00019 
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;winsock2.h&gt;</span>
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 <span class="preprocessor">#include &quot;connection.h&quot;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;constval.h&quot;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 
<a name="l00027"></a>00027 
<a name="l00032"></a><a class="code" href="class_client.html">00032</a> <span class="keyword">class </span><a class="code" href="class_client.html" title="客户端类">Client</a>{
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">public</span>:
<a name="l00035"></a>00035 
<a name="l00040"></a>00040     <span class="keyword">static</span> <a class="code" href="class_client.html" title="客户端类">Client</a> * <a class="code" href="class_client.html#ae57819d17e2d00f7235adcc99ca13d90">getSingleClient</a>();
<a name="l00041"></a>00041 
<a name="l00046"></a>00046     <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="class_client.html#a94b944a8f8349b58dd368deb964fceac">getPort</a>();
<a name="l00047"></a>00047 
<a name="l00051"></a>00051     <span class="keyword">static</span> <span class="keywordtype">void</span> *<a class="code" href="class_client.html#a7e8f83fbbe3efcd600f8fd8b2d993dd0">thread_accept</a>(<span class="keywordtype">void</span> *arg);
<a name="l00052"></a>00052 
<a name="l00058"></a>00058     <span class="keywordtype">void</span> <a class="code" href="class_client.html#a772c7deb25a57164e39f6c798140f21e">addConnection</a>(<a class="code" href="class_connection.html" title="连接类">Connection</a> *);
<a name="l00059"></a>00059 
<a name="l00066"></a>00066     <span class="keywordtype">int</span> <a class="code" href="class_client.html#a12eaa3ff4cac47109acb0764c0b689bf">startListen</a>(<span class="keywordtype">int</span> lisPort = 0);
<a name="l00067"></a>00067 
<a name="l00071"></a>00071     <span class="keywordtype">void</span> <a class="code" href="class_client.html#aef909de08ef481be9e915bd4deb81107">stopListen</a>();
<a name="l00072"></a>00072 
<a name="l00076"></a>00076     <span class="keywordtype">void</span> <a class="code" href="class_client.html#abfd2a6d2e31f7ad05b6003b6900bedcc">startCon</a>();
<a name="l00077"></a>00077 
<a name="l00091"></a>00091     <span class="keywordtype">void</span> <a class="code" href="class_client.html#abfd2a6d2e31f7ad05b6003b6900bedcc">startCon</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port, <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="struct____addr.html">addr</a>, <span class="keyword">const</span> <span class="keywordtype">int</span> nRequest, <span class="keyword">const</span> std::string &amp;str);
<a name="l00092"></a>00092 
<a name="l00096"></a>00096     <span class="keywordtype">void</span> <a class="code" href="class_client.html#adfe393bc28758353b25b900d9bb2ea7d">waitForCon</a>();
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 <span class="keyword">private</span>:
<a name="l00100"></a>00100 
<a name="l00102"></a>00102     <a class="code" href="class_client.html" title="客户端类">Client</a>();
<a name="l00103"></a>00103 
<a name="l00105"></a>00105     ~<a class="code" href="class_client.html" title="客户端类">Client</a>();
<a name="l00106"></a>00106 
<a name="l00108"></a>00108     <span class="keyword">static</span> <a class="code" href="class_client.html" title="客户端类">Client</a> * mInstance;
<a name="l00109"></a>00109 
<a name="l00111"></a>00111     std::vector&lt;Connection *&gt; m_connections;
<a name="l00112"></a>00112 
<a name="l00114"></a>00114     SOCKET m_listenfd;
<a name="l00115"></a>00115 
<a name="l00117"></a>00117     SOCKADDR_IN m_servAddr;
<a name="l00118"></a>00118 
<a name="l00120"></a>00120     pthread_t waitPid;
<a name="l00121"></a>00121 
<a name="l00123"></a>00123     <span class="keyword">static</span> <span class="keywordtype">int</span> m_lisPort;
<a name="l00124"></a>00124 
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 };
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 
<a name="l00129"></a>00129 <span class="preprocessor">#endif // CLIENT_H_INCLUDED</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>类型定义</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>枚举值</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address class="footer"><small>Generated at 2011年七月8日 星期五 15:50:01 for cute-transfer by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>
